/* 打开聊天窗口的按钮 */
.open-chat-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4703f4;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.open-chat-button:hover {
    font-weight: bold;
}

/* 聊天弹框容器 */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 聊天弹框遮罩层 */
.chat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* 整个聊天界面 */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 400px;
    height: 600px;
    background-color: #f5f5f5;
    font-family: 'Arial', sans-serif;
    z-index: 1001;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 聊天头部 */
.chat-header {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 24px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

/* 聊天窗口 */
.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #ffffff;
    border-bottom: 2px solid #ddd;
}

/* 单条消息 */
.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

/* 用户消息和客服消息 */
.user-message {
    flex-direction: row-reverse;
}

.server-message {
    flex-direction: row;
}

/* 头像 */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

/* 消息名称 */
.message-name {
    font-weight: bold;
    margin-bottom: 5px;
}

/* 消息内容 */
.message-content {
    max-width: 70%;
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 用户消息背景色 */
.user-message .message-content {
    background-color: #e1f5fe;
    color: #00796b;
    border-radius: 10px 10px 0 10px;
}

/* 客服消息背景色 */
.server-message .message-content {
    background-color: #e8eaf6;
    color: #1a237e;
    border-radius: 10px 10px 10px 0;
}

/* 输入框区域 */
.chat-input {
    display: flex;
    padding: 10px;
    background-color: #ffffff;
    border-top: 2px solid #ddd;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* 输入框样式 */
.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* 发送按钮样式 */
.chat-input button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
}

.chat-input button:hover {
    background-color: #45a049;
}

.emoji-picker {
    position: absolute;
    bottom: 40px;
    left: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.emoji-picker span {
    font-size: 20px;
    cursor: pointer;
}
/* 上传按钮样式 */
.chat-input button:nth-child(2) {
    background-color: #2196F3;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
}
.chat-input button:nth-child(2):hover {
    background-color: #1976D2;
}
.message-content img {
    max-width: 100px; /* 图片最大宽度为容器宽度 */
    max-height: 200px; /* 图片最大高度为 200px，可根据需求调整 */
    object-fit: contain; /* 保持图片比例，完整显示在容器内 */
    border-radius: 5px; /* 图片圆角 */
}